Skip to content

Fix: Avoid object mutation in skill manager and expert resolution#12

Merged
FL4TLiN3 merged 2 commits intomainfrom
fix/object-mutation
Dec 4, 2025
Merged

Fix: Avoid object mutation in skill manager and expert resolution#12
FL4TLiN3 merged 2 commits intomainfrom
fix/object-mutation

Conversation

@FL4TLiN3
Copy link
Contributor

@FL4TLiN3 FL4TLiN3 commented Dec 4, 2025

Summary

Test plan

  • Typecheck passes
  • Unit tests pass (updated tests to reflect new behavior)
  • E2E tests pass

Note

Eliminates object mutation in skill setup and expert resolution, moving caching to setupExperts and returning copied/converted structures.

  • Runtime:
    • Expert resolution (packages/runtime/src/resolve-expert-to-run.ts):
      • Stop mutating experts; return a converted expert via toRuntimeExpert.
      • Ensure skills from API include name for mcpStdioSkill/mcpSseSkill/interactiveSkill.
    • Expert setup (packages/runtime/src/setup-experts.ts):
      • Clone setting.experts; add resolved expertKey and its delegates to the local experts map.
      • Surface delegate-not-found error.
    • Skill managers (packages/runtime/src/skill-manager/helpers.ts):
      • Build MCP skill list immutably; when overriding base skill command, return a new skill object instead of mutating.
      • Preserve original skills while initializing managers.
  • Tests:
    • Update unit tests to reflect non-mutating behavior and new experts/delegates population.

Written by Cursor Bugbot for commit 4c233b8. This will update automatically on new commits. Configure here.

@vercel
Copy link

vercel bot commented Dec 4, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
perstack Ready Ready Preview Comment Dec 4, 2025 2:08am

@codecov
Copy link

codecov bot commented Dec 4, 2025

Codecov Report

❌ Patch coverage is 21.42857% with 11 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
packages/runtime/src/skill-manager/helpers.ts 0.00% 11 Missing ⚠️

📢 Thoughts on this report? Let us know!

@FL4TLiN3 FL4TLiN3 merged commit 50c1640 into main Dec 4, 2025
8 of 9 checks passed
@FL4TLiN3 FL4TLiN3 deleted the fix/object-mutation branch December 4, 2025 02:09
@github-actions github-actions bot mentioned this pull request Dec 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant